import App from './App'
import {$http} from '@escook/request-miniprogram'
import store from './store/store.js'

//把导入的包挂载到uni顶级对象中，以便全局使用
uni.$http = $http
//配置请求根路径
$http.baseUrl = 'https://www.uinav.com'
//请求开始前加载效果
$http.beforeRequest= function(){
	uni.showLoading({
		title:"数据加载中..."
	})
}
 //封装消息弹窗
 uni.$showMge = function(title ='数据加载失败!',duration = 1500){
	 uni.showToast({
	   title,
	   duration,
	   icon: 'none',
	 })
 }
//请求之后
$http.afterRequest = function(){
	uni.hideLoading()
}
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App,
	store
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif